<?php

class CategoryModel extends Model {

	public $table = '360_categorys';

	public function GetBigCategory(){
		return $this->group(" pid ")->select();
	}
	public function GetMinCategory($cid){
		$Field = $this->where("cid = $cid")->find();
		$Sql = " SELECT * FROM ".$this->table." WHERE pid =".$Field['pid'];
		return $this->query($Sql);
	}
	public function getAll(){
		$Big = $this->GetBigCategory();
		foreach ($Big as $key => $value) {
			$Big[$key]['min'] = $this->GetMinCategory($value['cid']);	
		}
		return $Big;
	}

	public function AskList(){
		return $this->select();
	}
}


?>